home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / upc12bs1.zip / UUCICO / fossil.h < prev    next >
C/C++ Source or Header  |  1993-05-30  |  7KB  |  152 lines

  1. #ifndef FOSSIL_H
  2. #define FOSSIL_H
  3.  
  4. /*--------------------------------------------------------------------*/
  5. /*       f o s s i l . h                                              */
  6. /*                                                                    */
  7. /*       UUPC/extended defines for accessing FOSSIL functions via     */
  8. /*       INT 14 under MS-DOS.                                         */
  9. /*--------------------------------------------------------------------*/
  10.  
  11. /*--------------------------------------------------------------------*/
  12. /*    Changes Copyright (c) 1990-1993 by Kendra Electronic            */
  13. /*    Wonderworks.                                                    */
  14. /*                                                                    */
  15. /*    All rights reserved except those explicitly granted by the      */
  16. /*    UUPC/extended license agreement.                                */
  17. /*--------------------------------------------------------------------*/
  18.  
  19. /*--------------------------------------------------------------------*/
  20. /*                          RCS Information                           */
  21. /*--------------------------------------------------------------------*/
  22.  
  23. /*
  24.  *    $Id: FOSSIL.H 1.2 1993/05/30 15:27:22 ahd Exp $
  25.  *
  26.  *    Revision history:
  27.  *    $Log: FOSSIL.H $
  28.  * Revision 1.2  1993/05/30  15:27:22  ahd
  29.  * Correct CTS high macro
  30.  *
  31.  * Revision 1.1  1993/05/30  00:16:35  ahd
  32.  * Initial revision
  33.  *
  34.  */
  35.  
  36. /*--------------------------------------------------------------------*/
  37. /*       FOSSIL function calls, taken from "Fundamentals of FOSSIL    */
  38. /*       Implementation and Use:  Version 5, February 11, 1988 by     */
  39. /*       Rick Moore of Solar Wind Computing.                          */
  40. /*--------------------------------------------------------------------*/
  41.  
  42. #define FS_INTERRUPT 0x14        // Fossil uses INT 14
  43.  
  44. /*--------------------------------------------------------------------*/
  45. /*       Function calls numbers, placed in AH before interrupt        */
  46. /*--------------------------------------------------------------------*/
  47.  
  48. #define FS_SPEED     0x00        // Set speed, parity, stop bits, char len
  49. #define FS_XMIT1     0x01        // Transmit one character (blocking write)
  50. #define FS_RECV1     0x02        // Receive one character (blocking read)
  51. #define FS_STATPORT  0x03        // Return port status
  52. #define FS_OPENPORT  0x04        // Initialize port
  53. #define FS_CLOSPORT  0x05        // Close port
  54. #define FS_DTR       0x06        // Raise/lower DTR
  55. #define FS_TIMESTAT  0x07        // Return system timer parameters
  56. #define FS_XMITWAIT  0x08        // Wait for output queue to transmit
  57. #define FS_XMITPURG  0X09        // Purge output queue w/o transmit
  58. #define FS_RECVPURG  0x0a        // Purge unread input queue
  59. #define FS_XMIT1NOW  0x0b        // Transmit one character (nonblocking)
  60. #define FS_PEEK1     0x0c        // Non-destructive port read
  61. #define FS_KEYBPEEK  0x0d        // Non-destructive keyboard read
  62. #define FS_KEYBREAD  0x0e        // Destructive keyboard read (blocking)
  63. #define FS_FLOWCNTL  0x0f        // Enable/disable flow control
  64. #define FS_CNTLCHEK  0x10        // Enable/disable Cntl-C/Cntl-K checking
  65. #define FS_SCURSOR   0x11        // Set screeen cursor location
  66. #define FS_RCURSOR   0x12        // Read screen cursor location
  67. #define FS_ANSICHAR  0x13        // Write character with ANSI control
  68. #define FS_WATCHDOG  0x14        // Auto-reboot on lost carrier
  69. #define FS_PUTCHAR   0x15        // BIOS level screen put
  70. #define FS_TIMECHN   0x16        // Insert/delete items on timer chain
  71. #define FS_REBOOT    0x17        // Perform Vulcan nerve pinch on system
  72. #define FS_READBLOK  0x18        // Read block of data from port
  73. #define FS_WRITBLOK  0x19        // Write block of data to port
  74. #define FS_BREAK     0x1A        // Enable/disable break on port
  75. #define FS_DRIVINFO  0x1B        // Get driver information
  76.  
  77. typedef struct _FS_INFO {        // Data returned by FS_DRIVINFO
  78.    short size;                   // Data bytes returned
  79.    char  version;                // FOSSIL specification version used
  80.    char  revision;               // Driver revision level
  81.    char  UUFAR *id;              // Pointer to ASCII driver id
  82.    short inputSize;              // Input buffer size
  83.    short inputFree;              // Bytes free in input queue
  84.    short outputSize;             // Bytes queued for output;
  85.    short outputFree;             // Bytes free in output queue
  86.    char  width;                  // Screen width in characters
  87.    char  height;                 // Screen height in characters
  88.    char  baudmask;               // Baud rate in format used by FS_SPEED
  89. } FS_INFO;
  90.  
  91. /*--------------------------------------------------------------------*/
  92. /*              Define macros to perform basic functions              */
  93. /*--------------------------------------------------------------------*/
  94.  
  95. #define FSSetSpeed( speed, parity, stopBits, charLen ) \
  96.          FossilCntl(FS_SPEED, (char) \
  97.                     ((speed << 5) | (parity << 3) | \
  98.                     (stopBits << 2) | charLen))
  99.  
  100. #define FS_NO_PARITY    0
  101. #define FS_NO_PARITYX   1
  102. #define FS_ODD_PARITY   2
  103. #define FS_EVEN_PARITY  3
  104.  
  105. #define FS_STOPBIT_1    0
  106. #define FS_STOPBIT_15   1           // For five bit character only
  107. #define FS_STOPBIT_2    1           // For all but five bit characters
  108.  
  109. #define FS_CHARLEN_5    0
  110. #define FS_CHARLEN_6    1
  111. #define FS_CHARLEN_7    2
  112. #define FS_CHARLEN_8    3
  113.  
  114. #define FSOpen( )           FossilCntl(FS_OPENPORT, 0)
  115.  
  116. #define FS_COOKIE    0x1954      // Success result from FS_OPENPORT
  117.  
  118. #define FSClose( )          FossilCntl(FS_CLOSPORT, 0)
  119.  
  120. #define FSStatus( )         FossilCntl(FS_STATPORT, 0)
  121.  
  122. #define FS_STAT_OUTPEMPT   0x4000   // Output buffer empty
  123. #define FS_STAT_OUTPROOM   0x2000   // Output buffer not full
  124. #define FS_STAT_OVERRUN    0x0200   // Input buffer overrun
  125. #define FS_STAT_INQUEUED   0x0100   // Characters in input buffer
  126. #define FS_STAT_DCD        0x0080   // Data carrier detected
  127.  
  128. #define FSFlushXmit( )      FossilCntl(FS_XMITPURG, 0)
  129.  
  130. #define FSFlushRecv( )      FossilCntl(FS_RECVPURG, 0)
  131.  
  132. #define FSFlowControl(type) FossilCntl(FS_FLOWCNTL, (char) (0xf0 | (type)))
  133.  
  134. #define FS_NOFLOW   0x00
  135. #define FS_XONXMIT  0x01
  136. #define FS_CTSRTS   0x04
  137. #define FS_XONRECV  0x08
  138.  
  139. #define FSDTR( onoroff )    FossilCntl(FS_DTR, onoroff)
  140.  
  141. #define FSBreak( onoroff )  FossilCntl(FS_BREAK, onoroff)
  142.  
  143. /*--------------------------------------------------------------------*/
  144. /*        Define information for routines and data in fossil.c        */
  145. /*--------------------------------------------------------------------*/
  146.  
  147. extern short portNum;        // Must be set by openline()
  148.  
  149. short FossilCntl( const char function, const char info );
  150.  
  151. #endif
  152.